﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace AppFlat.Domain.IRespostroy
{
    public interface IBaseRespostory<T>
    {
        void Add(T model);
        void Update(T model);
        void Update(T model, params string[] updateFields);

        void Delete(T model);

        Task<T> GetEntityAsync(Expression<Func<T, bool>> whereLambda);

        IQueryable<T> GetEntities(Expression<Func<T, bool>> whereLambda);

        IQueryable<T> GetEntities<OrderField>(int pageIndex, int pageSize, out int total,
            Expression<Func<T, bool>> whereLambda, Expression<Func<T, OrderField>> orderBy, bool isAsc);


        int ExecuteNonQuery(string sql, SqlParameter[] sp);
    }
}
